/**
 * 公式渲染
 */

export default {
  render: ($dom) => {
    $dom.find('.markdown-body-math').each(function() {
      let $this = $$(this);
      let text = $this.text();

      $this.html('');
      katex.render(text, $this[0], {
        displayMode: $this.is('p'),
        throwOnError: false
      });
    });
  }
}